import request from "@/utils/requestMd5";

export function goods_index(params) {
  return request({
    url: "/goods/index",
    method: "get",
    params
  });
}

export function goods_batchStatus(data) {
  return request({
    url: "/goods/batchStatus",
    method: "post",
    data: data
  });
}

//新增需要的数据
export function goods_base(params) {
  return request({
    url: "/goods/standardBase",
    method: "get",
    params
  });
}

//新增商品
export function goods_add(data) {
  return request({
    url: "/goods/addStandardGoods",
    method: "post",
    data: data
  });
}
//修改商品
export function goods_edit(data) {
  return request({
    url: "/goods/editStandardGoods",
    method: "post",
    data: data
  });
}

//标准库商品详情
export function standardDetail(params) {
  return request({
    url: "/goods/standardDetail",
    method: "get",
    params
  });
}

//非标准库商品详情
export function nonStandardDetail(params) {
  return request({
    url: "/goods/nonStandardDetail",
    method: "get",
    params
  });
}

//非标准库商品导入标准库
export function importStandard(data) {
  return request({
    url: "/goods/importStandard",
    method: "post",
    data
  });
}

//验证商品名唯一
export function goods_check(data) {
  return request({
    // url: "/goods/check",
    url: "/goods/standardCheck",
    method: "post",
    data: data
  });
}

// export function goods_edit(data) {
//   return request({
//     url: "/goods/edit",
//     method: "post",
//     data: data
//   });
// }

export function goods_info(params) {
  return request({
    url: "/goods/info",
    method: "get",
    params
  });
}

export function goods_delete(data) {
  return request({
    url: "/goods/delete",
    method: "post",
    data: data
  });
}


// 导出接口
export function export_goods_list(data) {
  return request({
    url: "/export/goods",
    method: "post",
    responseType: "blob",
    data: data
  });
}
